<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>foutir</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="fouti.html" title="fouti" />
    <link rel="next" href="foutk.html" title="foutk" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">foutir</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="fouti.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="foutk.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="foutir"></a>
      <div class="titlepage"></div>
      <a id="IndexFoutir" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">foutir</span>
        </h2>
        <p>foutir — 
      Outputs i-rate signals from an arbitrary number of channels to a specified file.
          </p>
      </div>
      <div class="refsect1">
        <a id="idp110885648"></a>
        <h2>Description</h2>
        <p>
      <span class="emphasis"><em>foutir</em></span> output <span class="emphasis"><em>N</em></span> i-rate signals to a specified file of <span class="emphasis"><em>N</em></span> channels.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp110888128"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>foutir</strong></span> ihandle, iformat, iflag, iout1 [, iout2, iout3,....,ioutN]</pre>
      </div>
      <div class="refsect1">
        <a id="idp110890144"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ihandle</em></span> -- a number which specifies this file.
    </p>
        <p>
      <span class="emphasis"><em>iformat</em></span> -- a flag to choose output file format:
      </p>
        <div class="itemizedlist">
          <ul class="itemizedlist" style="list-style-type: disc; ">
            <li class="listitem">
              <p>0 - floating point in text format</p>
            </li>
            <li class="listitem">
              <p>1 - 32-bit floating point in binary format</p>
            </li>
          </ul>
        </div>
        <p>
    </p>
        <p>
      <span class="emphasis"><em>iflag</em></span> -- choose the mode of writing to the ASCII file (valid only in ASCII mode; in binary mode <span class="emphasis"><em>iflag</em></span> has no meaning, but it must be present anyway). <span class="emphasis"><em>iflag</em></span> can be a value chosen among the following:
      </p>
        <div class="itemizedlist">
          <ul class="itemizedlist" style="list-style-type: disc; ">
            <li class="listitem">
              <p>0 - line of text without instrument prefix</p>
            </li>
            <li class="listitem">
              <p>1 - line of text with instrument prefix (see below)</p>
            </li>
            <li class="listitem">
              <p>2 - reset the time of instrument prefixes to zero (to be used only in some particular cases. See below)</p>
            </li>
          </ul>
        </div>
        <p>
    </p>
        <p>
      <span class="emphasis"><em>iout,..., ioutN</em></span> -- values to be written to the file
    </p>
      </div>
      <div class="refsect1">
        <a id="idp110900368"></a>
        <h2>Performance</h2>
        <p>
      <a class="link" href="fouti.html" title="fouti"><em class="citetitle">fouti</em></a> and <span class="emphasis"><em>foutir</em></span> write i-rate values to a file. The main use of these opcodes is to generate a score file during a realtime session. For this purpose, the user should set <span class="emphasis"><em>iformat</em></span> to 0 (text file output) and <span class="emphasis"><em>iflag</em></span> to 1, which enable the output of a prefix consisting of the strings <span class="emphasis"><em>inum</em></span>, <span class="emphasis"><em>actiontime</em></span>, and <span class="emphasis"><em>duration</em></span>, before the values of <span class="emphasis"><em>iout1...ioutN</em></span> arguments. The arguments in the prefix refer to instrument number, action time and duration of current note.
    </p>
        <p>
      The difference between <a class="link" href="fouti.html" title="fouti"><em class="citetitle">fouti</em></a> and <span class="emphasis"><em>foutir</em></span> is that, in the case of <span class="emphasis"><em>fouti</em></span>, when <span class="emphasis"><em>iflag</em></span> is set to 1, the duration of the first opcode is undefined (so it is replaced by a dot). Whereas, <span class="emphasis"><em>foutir</em></span> is defined at the end of note, so the corresponding text line is written only at the end of the current note (in order to recognize its duration). The corresponding file is linked by the <span class="emphasis"><em>ihandle</em></span> value generated by the <a class="link" href="fiopen.html" title="fiopen"><em class="citetitle">fiopen</em></a> opcode. So <span class="emphasis"><em>fouti</em></span> and <span class="emphasis"><em>foutir</em></span> can be used to generate a Csound score while playing  a realtime session.
    </p>
        <p>
      Notice that <a class="link" href="fout.html" title="fout"><em class="citetitle">fout</em></a> and <a class="link" href="foutk.html" title="foutk"><em class="citetitle">foutk</em></a> can use either a string containing a file pathname, or a handle-number generated by <a class="link" href="fiopen.html" title="fiopen"><em class="citetitle">fiopen</em></a>. Whereas, with <a class="link" href="fouti.html" title="fouti"><em class="citetitle">fouti</em></a> and <span class="emphasis"><em>foutir</em></span>, the target file can be only specified by means of a handle-number.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp110916592"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the foutir opcode. It uses the file <a class="ulink" href="examples/foutir.csd" target="_top"><em class="citetitle">foutir.csd</em></a>and creates a list "foutir.sco". It can be used as a score file.
      </p>
        <div class="example">
          <a id="idp110918496"></a>
          <p class="title">
            <strong>Example 319. Example of the foutir opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
 
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac  -+rtmidi=virtual -M0  <span class="comment">;;;realtime audio out and midi in</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if realtime audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o foutir.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>
 

<span class="ohdr">sr</span> <span class="op">=</span> 44100 
<span class="ohdr">ksmps</span> <span class="op">=</span> 32 
<span class="ohdr">nchnls</span> <span class="op">=</span> 2 
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1 

gihand <span class="opc">fiopen</span> "foutir.sco", 0 

<span class="oblock">instr</span> 1 <span class="comment">; play virtual midi keyboard</span>

inot  <span class="opc">notnum</span>  <span class="comment">;just for priting on screen</span>
icps  <span class="opc">cpsmidi</span>    
iamp  <span class="opc">ampmidi</span> 1

      <span class="opc">foutir</span>  gihand, 0, 1, icps, iamp 
      <span class="opc">prints</span>  "WRITING<span class="op">:</span>\n"
      <span class="opc">prints</span>  "note <span class="op">=</span> <span class="op">%</span>f,velocity <span class="op">=</span> <span class="op">%</span>f\n", icps, iamp  <span class="comment">;prints them</span>
      <span class="opc">ficlose</span> gihand
asig  <span class="opc">pluck</span>   iamp, icps, 1000, 0, 1
      <span class="opc">outs</span>    asig, asig

<span class="oblock">endin</span> 
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
 

<span class="stamnt">f</span> 0 10

<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp110922784"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="fiopen.html" title="fiopen"><em class="citetitle">fiopen</em></a>,
      <a class="link" href="fout.html" title="fout"><em class="citetitle">fout</em></a>,
      <a class="link" href="fouti.html" title="fouti"><em class="citetitle">fouti</em></a>,
      <a class="link" href="foutk.html" title="foutk"><em class="citetitle">foutk</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp110927712"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Gabriel Maldonado</td>
          </tr>
          <tr>
            <td>Italy</td>
          </tr>
          <tr>
            <td>1999</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in Csound version 3.56</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="fouti.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="foutk.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">fouti </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> foutk</td>
        </tr>
      </table>
    </div>
  </body>
</html>
